<html>
	<head>
<title>学生信息修改</title>
		<meta charset="utf-8" />
		<style type=text/css>
    body{
        background-image:url(jrjm.jpg) ;
		background-size:cover;
	    background-attachment: fixed;
	    background-repeat:no-repeat;
        color:#ffc0cb;
          }  
	.div1{
			text-align:center; 
	 }
	 a{
			text-decoration:none;
			color:#ffc0cb;

		  }
	.sc1:hover{color:red;}
	ul{
		    width:900px;
            height:700px;
            border:1px solid #ffc0cb;
            box-sizing: border-box;
			list-style-type: none;
			margin-left:25%; 
	}	  
	.yh{
		color:#F08080;
		margin-top:1%;
		padding-left:650px;
	}
	.fs{
		border-spacing:5px;
		margin-top:5%;
		padding-right:50px;
		text-align:center;
		width:900px;
	}
	 th{
		color:#FA8072;
	}
	.cx{
		padding-left:150px;
	}
    </style>
	</head>
	<body>
		<div class="div1">
	<h1>成凡大学学生信息管理系统</h1>
</div>
		<ul>
		<li class="yh">当前用户：
		<?php
        session_start();
        if(isset($_SESSION['name'])){
        echo $_SESSION['name'];
        }else{
        echo "<script>alert('你无权访问本网页，请先登录');history.go(-1);</script>";} 
        ?>	
		</li>
        <?php
        require 'conn.php';
		if($_GET['action']=='xg'){
			$xh=$_GET['xh'];
			$result=mysqli_query($link,"select * from xs where xh=".$xh);
			$xsxx=mysqli_fetch_assoc($result);
		}
        ?>



       <form name="form1" method="post" action="xg_ok.php">
        <table style="border-collapse:separate; border-spacing:0px 10px;">
        <tr>
        <td width="150" align="center">学&nbsp;&nbsp;&nbsp;号：</td>
        <td width="600" height="50" >
        <input name="xh" type="text" id="xh" style="width:200px;height:30px" value="<?php echo $xsxx['xh']; ?>"></td><br>
      </tr>

        <tr>
        <td align="center">姓&nbsp;&nbsp;&nbsp;名：</td>
        <td ><input name="name" type="text" id="name" style="width:200px;height:30px"  value="<?php echo $xsxx['name']; ?>"></td></br>
	</tr>

      <tr>
        <td align="center">性&nbsp;&nbsp;&nbsp;别：</td>
        <td>
		<select name="xb"  id="xb" style="width:150px;height:30px" >
		<?php 
        include("conn.php");
		$sql3=mysqli_query($link,"select  distinct xb  from xs");
    $info=mysqli_fetch_array($sql3);
    do{
      ?> 
        <option value="<?php echo $info['xb'];?>"<?php if($info['xb']==$xsxx['xb']){?> selected <?php }?>><?php echo $info['xb'];?></option>
      <?php }while($info=mysqli_fetch_array($sql3)); ?> 
        </select>
		</td></br>
      </tr>

      <tr>
        <td align="center">班&nbsp;&nbsp;&nbsp;级：</td>
        <td>
		<select name="bj"  id="bj" style="width:150px;height:30px" >
		<?php 
        include("conn.php");
		$sql=mysqli_query($link,"select distinct bj from xs");
		$info=mysqli_fetch_array($sql);
		 do{
		?> 		
        <option value="<?php echo $info['bj'];?>"<?php if($info['bj']==$xsxx['bj']){?> selected <?php }?>><?php echo $info['bj'];?></option>
		<?php }while($info=mysqli_fetch_array($sql)); ?> 
        </select>
		</td></br>
      </tr>

      <tr>
        <td align="center">专&nbsp;&nbsp;&nbsp;业：</td>
        <td>
		<select name="zy"  id="zy" style="width:150px;height:30px">

		<?php
        include("conn.php");
		$sql2=mysqli_query($link,"select  distinct zy from xs");
		$info2=mysqli_fetch_array($sql2);
		do{
		?> 		
		<option value="<?php echo $info2['zy'];?>"<?php if($info2['zy']==$xsxx['zy']){?> selected <?php }?>><?php echo $info2['zy'];?></option>
		<?php }while($info2=mysqli_fetch_array($sql2));?> 
        </select> 
    </br>
		</td>
      </tr>

      <tr>
        <td align="center">联系电话：</td>
        <td ><input name="dh" type="text" id="dh" size="20" style="width:200px;height:30px"   value="<?php echo $xsxx['dh']; ?>"></td></br>
      </tr>

      <tr>
        <td align="center">家庭地址：</td>
        <td><input name="jtdz" type="text" id="jtdz" size="40" style="height:30px"  value="<?php echo $xsxx['jtdz']; ?>"></td>
      </tr>

      <tr>
        <td align="center">&nbsp;</td>
        <td><input name="Submit" type="submit" class="btn_grey" value="保存" onClick="return check(form1)" >&nbsp;
			<input name="Submit2" type="button" class="btn_grey" value="返回" onClick="history.back();"></td>
      </tr>
        </table>
        </form>  
		</ul>
		<?php include("bq.php"); ?>
	</body>
</html>